package cn.sytton.taffe.framework.log;

/**
 * 日志记录数据唯一ID工具
 *
 * @author skyrock
 */
public class LogHelper {

    /**
     * 使用ThreadLocal维护变量隔离不同数据源之间的操作
     */
    private static final ThreadLocal<String> CONTEXT_THREAD_LOG = new ThreadLocal<>();

    public static void setData(String data) {
        CONTEXT_THREAD_LOG.set(data);
    }

    public static String getData() {
        String data = CONTEXT_THREAD_LOG.get();
        CONTEXT_THREAD_LOG.remove();
        return data;
    }

}
